'++LotusScript Development Environment:2:5:(Options):0:66 '++LotusScript Development Environment:2:5:(Forward):0:1 Declare Sub Click(Source As Button, X As Long, Y As Long, Flags As Long) Declare Function FindBrowser As String Declare Function FindSmartMasterDir As String Declare Function FindNotePad As String Declare Sub Sub2 Declare Function FindNTBrowser As String Declare Function FindNTNotepad As String Declare Function FindNTSmasters As String '++LotusScript Development Environment:2:5:(Declarations):0:2 '++LotusScript Development Environment:2:2:BindEvents:1:129 Private Sub BindEvents(Byval Objectname_ As String) Static Source As BUTTON Set Source = Bind(Objectname_) On Event Click From Source Call Click End Sub '++LotusScript Development Environment:2:2:Click:1:12 Sub Click(Source As Button, X As Long, Y As Long, Flags As Long) On Error Resume Next Dim pathReadme, npath, mybrowser As String pathReadme = FindSmartMasterDir findReadme = Dir(pathReadme & "Readme.htm") 'Check on NT: If findReadme="" Then pathReadme=FindNTSmasters End If findReadme = Dir(pathReadme & "Readme.htm") If findReadme = "" Then 'If we couldn't locate the readme's on either win95 or NT, Msgbox "Could Not Locate Readme" & Chr(10) & "Please check installation of smartmaster",,"Error Locating ReadMe" Exit Sub End If MyBrowser = FindBrowser If MyBrowser="" Then 'Check on NT MyBrowser=FindNTBrowser End If If MyBrowser = "" Then ' Must not have found the browser on win95 or NT npath = FindNotepad If npath="" Then 'check on NT, npath=FindNTNotepad End If On Error Resume Next rval = Shell( npath + " " + pathReadme + "Readme.txt") Activateapp("readme") Sendkeys "~~", 0 Exit Sub End If 'Format pathReadme for URL address: pathReadme = Left$(pathReadme,1) & "|" & Right$(pathReadme, (Len(pathReadme)-2)) rval = Shell(MyBrowser & " file:///" & pathReadme & "Readme.htm") On Error Resume Next Activateapp("Netscape") Sendkeys "~~", 0 Err = 0 End Sub '++LotusScript Development Environment:2:1:FindBrowser:1:8 Function FindBrowser As String Dim happkey As Long Dim HKEY_LOCAL_MACHINE As Long Dim KEY_READ As Long Dim HKEY_CURRENT_USER As Long Dim HKEY_CLASSES_ROOT As Long Dim ValueType As Long Dim ReturnedKeyContents As String * 255 Dim readbytes As Long Dim ReturnString As String * 255 MaxBytes%=Len(ReturnString$) IniFileName$ = "Win.Ini" ReturnedKeycontents$=String$(255,Chr$(32)) HKEY_CLASSES_ROOT= &H80000000 HKEY_CURRENT_USER= &H80000001 HKEY_LOCAL_MACHINE= &H80000002 KEY_QUERY_VALUE=1 KEY_ENUMERATE_SUBKEYS=8 KEY_NOTIFY=16 KEY_READ=KEY_QUERY_VALUE Or KEY_ENUMERATE_SUBKEYS Or KEY_NOTIFY KeyName$="http\shell\open\command" ValueName$="" 'lstat=RegOpenKeyExA(HKEY_CLASSES_ROOT,KeyName$,0,KEY_READ,happkey) lstat=RegOpenKeyExA(HKEY_CLASSES_ROOT,KeyName$,0,KEY_READ,happkey) ReadBytes=255 lstat=RegQueryValueExA(happkey,ValueName$,0,valueType, ReturnedKeyContents$,ReadBytes) regclosekey(happkey) If Trim$(ReturnedKeyContents$)="" Then 'The DB2 Web Sizing Assistant Cannot Locate Your Browser FindBrowser="" Exit Function End If BrowserPath$=Left$(ReturnedKeyContents$,ReadBytes-1) BrowserPath$=Lcase$(BrowserPath$) ExePos=Instr(BrowserPath$,".exe") If ExePos<>0 Then 'Strip off the extra ending quote and command line parameters BrowserPath$=Left$(BrowserPath$,ExePos+3) End If ' return path without leading quote, if there is one: QuotePos=Instr(BrowserPath$,Chr$(34)) If QuotePos<>0 Then BrowserPath$=Mid$(BrowserPath$,QuotePos+1) End If FindBrowser=BrowserPath$ End Function '++LotusScript Development Environment:2:1:FindSmartMasterDir:1:8 Function FindSmartMasterDir As String Dim happkey As Long Dim HKEY_LOCAL_MACHINE As Long Dim KEY_READ As Long Dim HKEY_CURRENT_USER As Long Dim HKEY_CLASSES_ROOT As Long Dim ValueType As Long Dim ReturnedKeyContents As String * 255 Dim readbytes As Long Dim ReturnString As String * 255 MaxBytes%=Len(ReturnString$) IniFileName$ = "Win.Ini" ReturnedKeycontents$=String$(255,Chr$(32)) HKEY_CLASSES_ROOT= &H80000000 HKEY_CURRENT_USER= &H80000001 HKEY_LOCAL_MACHINE= &H80000002 KEY_QUERY_VALUE=1 KEY_ENUMERATE_SUBKEYS=8 KEY_NOTIFY=16 KEY_READ=KEY_QUERY_VALUE Or KEY_ENUMERATE_SUBKEYS Or KEY_NOTIFY KeyName$="Software\Lotus\approach\97.0\Paths\SMasters" ValueName$="EN" lstat=RegOpenKeyExA(HKEY_CURRENT_USER,KeyName$,0,KEY_READ,happkey) ReadBytes=255 lstat=RegQueryValueExA(happkey,ValueName$,0,valueType, ReturnedKeyContents$,ReadBytes) regclosekey(happkey) If Trim$(ReturnedKeyContents$)="" Then 'Messagebox("The DB2 Web Sizing Assistant Cannot Find Readme.") FindSmartMasterDir="" Exit Function End If ReadMePath$=Left$(ReturnedKeyContents$,ReadBytes-1) ' return path without leading quote, if there is one: QuotePos=Instr(ReadMePath$,Chr$(34)) If QuotePos<>0 Then ReadMePath$=Mid$(ReadMePath$,QuotePos+1) End If FindSmartMasterDir=ReadMePath$ End Function '++LotusScript Development Environment:2:1:FindNotePad:1:8 Function FindNotePad As String Dim happkey As Long Dim HKEY_LOCAL_MACHINE As Long Dim KEY_READ As Long Dim HKEY_CURRENT_USER As Long Dim HKEY_CLASSES_ROOT As Long Dim ValueType As Long Dim ReturnedKeyContents As String * 255 Dim readbytes As Long Dim ReturnString As String * 255 MaxBytes%=Len(ReturnString$) IniFileName$ = "Win.Ini" ReturnedKeycontents$=String$(255,Chr$(32)) HKEY_CLASSES_ROOT= &H80000000 HKEY_CURRENT_USER= &H80000001 HKEY_LOCAL_MACHINE= &H80000002 KEY_QUERY_VALUE=1 KEY_ENUMERATE_SUBKEYS=8 KEY_NOTIFY=16 KEY_READ=KEY_QUERY_VALUE Or KEY_ENUMERATE_SUBKEYS Or KEY_NOTIFY KeyName$="txtfile\shell\open\command" ValueName$="" 'lstat=RegOpenKeyExA(HKEY_CLASSES_ROOT,KeyName$,0,KEY_READ,happkey) lstat=RegOpenKeyExA(HKEY_CLASSES_ROOT,KeyName$,0,KEY_READ,happkey) ReadBytes=255 lstat=RegQueryValueExA(happkey,ValueName$,0,valueType, ReturnedKeyContents$,ReadBytes) regclosekey(happkey) If Trim$(ReturnedKeyContents$)="" Then 'The DB2 Web Sizing Assistant Cannot Locate Your Browser FindNotePad = "" Exit Function End If NPath$=Left$(ReturnedKeyContents$,ReadBytes-1) NPath$=Lcase$(NPath$) ExePos=Instr(NPath$,".exe") If ExePos<>0 Then 'Strip off the extra ending quote and command line parameters NPath$=Left$(NPath$,ExePos+3) End If ' return path without leading quote, if there is one: QuotePos=Instr(NPath$,Chr$(34)) If QuotePos<>0 Then NPath$=Mid$(NPath$,QuotePos+1) End If 'Check to see if this is a value from NT 4.0: If Left(Lcase$(NPath$), 12) = "%systemroot%" Then NPath$ = "notepad" End If FindNotePad=NPath$ End Function '++LotusScript Development Environment:2:2:Sub2:1:8 Sub Sub2 pathReadme = FindSmartMasterDir findReadme = Dir(pathReadme & "Readme.htm") 'Check on NT: If findReadme="" Then pathReadme=FindNTSmasters End If findReadme = Dir(pathReadme & "Readme.htm") If MyBrowser = "" Then ' Must not have found the browser on win95 or NT npath = FindNotepad If npath="" Then 'check on NT, npath=FindNTNotepad End If On Error Resume Next rval = Shell( npath + " " + pathReadme + "Readme.txt") Exit Sub End If End Sub '++LotusScript Development Environment:2:1:FindNTBrowser:1:8 Function FindNTBrowser As String Dim happkey As Long Dim HKEY_LOCAL_MACHINE As Long Dim KEY_READ As Long Dim HKEY_CURRENT_USER As Long Dim HKEY_CLASSES_ROOT As Long Dim ValueType As Long Dim ReturnedKeyContents As String * 255 Dim readbytes As Long Dim ReturnString As String * 255 MaxBytes%=Len(ReturnString$) IniFileName$ = "Win.Ini" ReturnedKeycontents$=String$(255,Chr$(32)) HKEY_CLASSES_ROOT= &H80000000 HKEY_CURRENT_USER= &H80000001 HKEY_LOCAL_MACHINE= &H80000002 KEY_QUERY_VALUE=1 KEY_ENUMERATE_SUBKEYS=8 KEY_NOTIFY=16 KEY_READ=KEY_QUERY_VALUE Or KEY_ENUMERATE_SUBKEYS Or KEY_NOTIFY KeyName$="NetscapeMarkup\shell\open\command\" ValueName$="" 'lstat=RegOpenKeyExA(HKEY_CLASSES_ROOT,KeyName$,0,KEY_READ,happkey) lstat=RegOpenKeyExA(HKEY_CLASSES_ROOT,KeyName$,0,KEY_READ,happkey) ReadBytes=255 lstat=RegQueryValueExA(happkey,ValueName$,0,valueType, ReturnedKeyContents$,ReadBytes) regclosekey(happkey) If Trim$(ReturnedKeyContents$)="" Then 'The DB2 Web Sizing Assistant Cannot Locate Your Browser FindNTBrowser="" Exit Function End If BrowserPath$=Left$(ReturnedKeyContents$,ReadBytes-1) BrowserPath$=Lcase$(BrowserPath$) ExePos=Instr(BrowserPath$,".exe") If ExePos<>0 Then 'Strip off the extra ending quote and command line parameters BrowserPath$=Left$(BrowserPath$,ExePos+3) End If ' return path without leading quote, if there is one: QuotePos=Instr(BrowserPath$,Chr$(34)) If QuotePos<>0 Then BrowserPath$=Mid$(BrowserPath$,QuotePos+1) End If FindNTBrowser=BrowserPath$ End Function '++LotusScript Development Environment:2:1:FindNTNotepad:1:8 Function FindNTNotepad As String Dim happkey As Long Dim HKEY_LOCAL_MACHINE As Long Dim KEY_READ As Long Dim HKEY_CURRENT_USER As Long Dim HKEY_CLASSES_ROOT As Long Dim ValueType As Long Dim ReturnedKeyContents As String * 255 Dim readbytes As Long Dim ReturnString As String * 255 MaxBytes%=Len(ReturnString$) IniFileName$ = "Win.Ini" ReturnedKeycontents$=String$(255,Chr$(32)) HKEY_CLASSES_ROOT= &H80000000 HKEY_CURRENT_USER= &H80000001 HKEY_LOCAL_MACHINE= &H80000002 KEY_QUERY_VALUE=1 KEY_ENUMERATE_SUBKEYS=8 KEY_NOTIFY=16 KEY_READ=KEY_QUERY_VALUE Or KEY_ENUMERATE_SUBKEYS Or KEY_NOTIFY KeyName$="txtfile\shell\open\command\" ValueName$="" 'lstat=RegOpenKeyExA(HKEY_CLASSES_ROOT,KeyName$,0,KEY_READ,happkey) lstat=RegOpenKeyExA(HKEY_CLASSES_ROOT,KeyName$,0,KEY_READ,happkey) ReadBytes=255 lstat=RegQueryValueExA(happkey,ValueName$,0,valueType, ReturnedKeyContents$,ReadBytes) regclosekey(happkey) If Trim$(ReturnedKeyContents$)="" Then 'The DB2 Web Sizing Assistant Cannot Locate Your Browser FindNTNotePad = "" Exit Function End If NPath$=Left$(ReturnedKeyContents$,ReadBytes-1) NPath$=Lcase$(NPath$) ExePos=Instr(NPath$,".exe") If ExePos<>0 Then 'Strip off the extra ending quote and command line parameters NPath$=Left$(NPath$,ExePos+3) End If ' return path without leading quote, if there is one: QuotePos=Instr(NPath$,Chr$(34)) If QuotePos<>0 Then NPath$=Mid$(NPath$,QuotePos+1) End If FindNTNotePad=NPath$ End Function '++LotusScript Development Environment:2:1:FindNTSmasters:1:8 Function FindNTSmasters As String Dim happkey As Long Dim HKEY_LOCAL_MACHINE As Long Dim KEY_READ As Long Dim HKEY_CURRENT_USER As Long Dim HKEY_CLASSES_ROOT As Long Dim ValueType As Long Dim ReturnedKeyContents As String * 255 Dim readbytes As Long Dim ReturnString As String * 255 MaxBytes%=Len(ReturnString$) IniFileName$ = "Win.Ini" ReturnedKeycontents$=String$(255,Chr$(32)) HKEY_CLASSES_ROOT= &H80000000 HKEY_CURRENT_USER= &H80000001 HKEY_LOCAL_MACHINE= &H80000002 KEY_QUERY_VALUE=1 KEY_ENUMERATE_SUBKEYS=8 KEY_NOTIFY=16 KEY_READ=KEY_QUERY_VALUE Or KEY_ENUMERATE_SUBKEYS Or KEY_NOTIFY KeyName$="Software\Lotus\approach\97.0\Paths\SMasters" ValueName$="EN" lstat=RegOpenKeyExA(HKEY_CURRENT_USER,KeyName$,0,KEY_READ,happkey) ReadBytes=255 lstat=RegQueryValueExA(happkey,ValueName$,0,valueType, ReturnedKeyContents$,ReadBytes) regclosekey(happkey) If Trim$(ReturnedKeyContents$)="" Then 'Messagebox("The DB2 Web Sizing Assistant Cannot Find Readme.") FindNTSmasters="" Exit Function End If ReadMePath$=Left$(ReturnedKeyContents$,ReadBytes-1) ' return path without leading quote, if there is one: QuotePos=Instr(ReadMePath$,Chr$(34)) If QuotePos<>0 Then ReadMePath$=Mid$(ReadMePath$,QuotePos+1) End If FindNTSmasters=ReadMePath$ End Function